package day5;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        RentCompany a = new RentCompany();
        a.setName("神州行");
        a.setAdress("天水路");
        a.setNumber("18715173564");
        while (true) {
            a.show();
            System.out.println("1.查看车辆情况");
            System.out.println("2.租赁车辆");
            System.out.println("3.归还车辆");
            System.out.println("4.报废车辆");
            System.out.println("5.采购车辆");
            System.out.println("6.查看租赁记录");
            System.out.println("0.退出系统");
            System.out.println("请输入您的选择");
            int choice = input.nextInt();
            switch (choice) {
                case 1:
                    a.check();
                    break;
                case 2:

                    System.out.println("请输入您的选择：轿车/（客车)");
                    String chioce=input.next();
                    a.show(chioce);
                    System.out.println("请输入您的姓名");
                    String name=input.next();
                    System.out.println("请输入您要租的车的车牌");
                    String chepai=input.next();
                    System.out.println("请输入您要租的天数");
                    int days=input.nextInt();
                    a.rentcar(name,chepai,days);

                    break;
                case 3:
                    System.out.println("请输入要还车辆车牌号");
                    String no = input.next();
                    a.ruturncar(no);
                    break;
                case 4:
                    System.out.println("请输入要报废车辆的车牌号");
                    String num = input.next();
                    a.scrap(num);
                    break;
                case 5:
                    System.out.println("请输入您需要买的车类型：轿车/（客车)");
                    String type=input.next();
                    if (type.equals("轿车")){
                        Car car=new Car();
                        System.out.println("请输入您要采购的车辆信息");
                        System.out.println("<<<<<<<<<<<<<<<<");
                        System.out.println("汽车车牌号");
                        car.setVehicleid(input.next());
                        System.out.println("汽车品牌");
                        car.setBrand(input.next());
                        System.out.println("汽车日租金");
                        car.setRent(input.nextInt());
                        System.out.println("请输入汽车型号");
                        car.setState("当前可租");
                      car.setType(input.next());
                      a.buy(car);
                    }else  if (type.equals("客车")){
                         Bus bus=new Bus();
                        System.out.println("请输入您要采购的车辆信息");
                        System.out.println("<<<<<<<<<<<<<<<<");
                        System.out.println("客车车牌号");
                        bus.setVehicleid(input.next());
                        System.out.println("客车品牌");
                        bus.setBrand(input.next());
                        System.out.println("客车日租金");
                        bus.setRent(input.nextInt());
                        System.out.println("请输入客车座位数");
                        bus.setSeats(input.nextInt());
                        bus.setState("当前可租");
                        a.buy(bus);

                    }
                    break;
                case 6:
                    a.showsum();
                    break;
                default:
                    break;


            }if (choice==0){
                System.out.println("退出系统");
                break;
            }


        }
    }


}
